#include "stdafx.h"
#include "goal_enemy_attack.h"
#include "emotionalmemory.h"

using namespace BAA;

EmotionalMemory* BAA::Goal_Enemy_Attack::AppraiseEvent( Event * event )
{
	return NULL;
}

float BAA::Goal_Enemy_Attack::CalculateStateUtility( Agent * agent )
{


	AgentProperties * props = ParentRole()->Self()->Properties();

	float anger = 1- abs(mAngerPoint - (props->mAnger->GetValue() + (*(mRoleParent->Emotions()))["anger"]->GetValue())/2.0f);
	float fear = 1- abs(mFearPoint - (*(mRoleParent->Emotions()))["fear"]->GetValue());
	float honor = 1- abs(mHonorPoint - props->mHonor->Desire());
	float vengeance = 1- abs(mVengeance - props->mVengeance->Desire());

	float utility = (anger - fear + honor + vengeance)/4.0f;

	return utility;
	
}

float BAA::Goal_Enemy_Attack::CalculateUtilityForAction( Action * action )
{

	return 0.0f;

}